{% load static %}
<!-- Navbar -->
<nav class="navbar navbar-expand-lg navbar-dark bg-primary sticky-top">
  <div class="container">
    <a class="navbar-brand" href="{% url 'index' %}">
      <img src="{% static 'img/logo.png' %}" class="logo" style="width: 80px;" alt="">
    </a>
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup">
      <span class="navbar-toggler-icon"></span>
    </button>
    <div class="collapse navbar-collapse" id="navbarNavAltMarkup">
      <ul class="navbar-nav">
        <li 
        {% if '/' == request.path %}
          class="nav-item active mr-3"
        {% else %}
          class="nav-item mr-3"
        {% endif %}
        >
          <a class="nav-link" href="{% url 'index' %}">Home</a>
          <li>
          <li 
          {% if 'about' in request.path %}
            class="nav-item active mr-3"
          {% else %}
            class="nav-item mr-3"
          {% endif %}
          >
          <a class="nav-link" href="{% url 'about' %}">About</a>
        </li>
        <li 
          {% if 'listings' in request.path %}
            class="nav-item active mr-3"
          {% else %}
            class="nav-item mr-3"
          {% endif %}
        >
          <a class="nav-link" href="{% url 'listings' %}">Featured Listings</a>
        </li>
      </ul>

      <ul class="navbar-nav ml-auto">     <!-- 实现和其他导航栏项一样的高亮效果。 -->
        <li
        {% if 'register' in request.path %}    
          class="nav-item active mr-3"
        {% else %}
          class="nav-item mr-3"
        {% endif %}
        >
          <a class="nav-link" href="{% url 'register' %}">
            <i class="fas fa-user-plus"></i> Register</a>
        </li>           <!-- 实现和其他导航栏项一样的高亮效果。 -->
        <li
        {% if 'login' in request.path %}    
          class="nav-item active mr-3"
        {% else %}
          class="nav-item mr-3"
        {% endif %}
        >
          <a class="nav-link" href="{% url 'login' %}">   <!-- 修正 templates/partials/_navbar.html 中的注册和登录的路径。 -->
            <i class="fas fa-sign-in-alt"></i>

            Login</a>
        </li>
      </ul>
    </div>
  </div>
</nav>